#include "recordingwidget.h"

RecordingWidget::RecordingWidget(QWidget *parent) : QWidget(parent)
{
    setWindowFlags(Qt::FramelessWindowHint | Qt::WindowDoesNotAcceptFocus |Qt::WindowStaysOnTopHint);//
    setAttribute(Qt::WA_TranslucentBackground); //透明
    setAttribute(Qt::WA_TransparentForMouseEvents, true); //鼠标穿透
    setWindowFlags( Qt::X11BypassWindowManagerHint);
}

void RecordingWidget::paintEvent(QPaintEvent *)
{
    QPainter painter(this);
    painter.setRenderHint(QPainter::Antialiasing);
    painter.setPen(QPen(QColor("#3790FA"), 2, Qt::DashLine));   // 设置蓝色虚线
    painter.drawRect(this->rect().adjusted(1, 1, -1, -1));      //小一圈
}

void RecordingWidget::keyPressEvent(QKeyEvent *e)
{
    QWidget::keyPressEvent(e);
}
